import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
export class User {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'varchar', name: 'username', default: '' })
  username: string;

  @Column({ type: 'varchar', name: 'email', default: '' })
  email: string;

  @Column({ type: 'varchar', name: 'password', default: '' })
  password: string;

  @Column({ type: 'int', name: 'open_id', default: 0 })
  open_id: number;

  @Column({ type: 'varchar', name: 'avatar' })
  avatar: string;

  @Column()
  config: string;

  @Column({ type: 'varchar', name: 'verify_key' })
  verify_key: string;

  @Column()
  create_time: Date;

  @Column()
  updated_time: Date;
}
